import 'package:flutter/cupertino.dart';

class AppButton extends StatelessWidget {
  const AppButton({
    Key? key,
    required this.child,
    this.padding = EdgeInsets.zero,
    this.color,
    this.disabledColor = CupertinoColors.quaternarySystemFill,
    this.minSize = 0,
    this.pressedOpacity = 0.6,
    this.borderRadius = BorderRadius.zero,
    this.alignment = Alignment.center,
    required this.onPressed,
  }) : super(key: key);

  final Widget child;
  final EdgeInsetsGeometry padding;
  final Color? color;
  final Color disabledColor;
  final VoidCallback? onPressed;
  final double? minSize;
  final double? pressedOpacity;
  final BorderRadius? borderRadius;
  final AlignmentGeometry alignment;

  @override
  Widget build(BuildContext context) {
    return MouseRegion(
      cursor: SystemMouseCursors.click,
      child: CupertinoButton(
        padding: padding,
        color: color,
        disabledColor: disabledColor,
        minSize: minSize,
        pressedOpacity: pressedOpacity,
        borderRadius: borderRadius,
        alignment: alignment,
        onPressed: onPressed,
        child: child,
      ),
    );
  }
}
